if (this.help) {
	usage('set=<path>');
	usage('add=<path>');
	usage('del=<path>');
} else {
	include('chrome://technika/content/technika.js');

	function __set(val) {
		try {
			TH_setPref('extensions.technika.scripts.path', val);
			print(val);
		} catch (e) {
			error(e);
		}
	}

	function __add(pth) {
		var val = TH_getPref('extensions.technika.scripts.path', undefined);

		if (val == undefined) {
			__set(pth);
		} else {
			var pths = val.split(/\s*;\s*/);
			pths.push(pth);

			__set(pths.join(';'));
		}
	}

	function __del(pth) {
		var val = TH_getPref('extensions.technika.scripts.path', undefined);

		if (val == undefined) {
			print(val);
		} else {
			var new_pths = [];
			var pths = val.split(/\s*;\s*/);

			for (var i = 0; i < pths.length; i++) {
				if (pths[i] != pth) {
					new_pths.push(pths[i]);
				}
			}
			__set(new_pths.join(';'));
		}
	}

	if (this.set) {
		__set(this.set);
	}

	if (this.add) {
		__add(this.add);
	}

	if (this.del) {
		__del(this.del);
	}

	if (!this.set && !this.add && !this.del) {
		var val = TH_getPref('extensions.technika.scripts.path', undefined);

		if (val == undefined) {
			error('path not found');
		} else {
			print(val);
		}
	}
}
